]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Only change excluded-apps when not deleting folder
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 24 Sep 2020 15:41:27 +0000 (12:41 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 5 Oct 2020 12:06:47 +0000 (12:06 +0000)
It is useless to update the 'excluded-apps' list when we know we're going
to delete the folder entirely.

Only update 'excluded-apps' when not deleting the app folder.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447

js/ui/appDisplay.js

index ed735f5404f14d48920c7842cc41ba9b49a846da..66a4557bb7023d49ebe9a16db471f8878ef5e8cd 100644 (file)
@@ -1806,15 +1806,6 @@ class FolderView extends BaseAppView {
         if (index >= 0)
             folderApps.splice(index, 1);
 
-        // If this is a categories-based folder, also add it to
-        // the list of excluded apps
-        let categories = this._folder.get_strv('categories');
-        if (categories.length > 0) {
-            let excludedApps = this._folder.get_strv('excluded-apps');
-            excludedApps.push(app.id);
-            this._folder.set_strv('excluded-apps', excludedApps);
-        }
-
         // Remove the folder if this is the last app icon; otherwise,
         // just remove the icon
         if (folderApps.length == 0) {
@@ -1828,6 +1819,15 @@ class FolderView extends BaseAppView {
             folders.splice(folders.indexOf(this._id), 1);
             settings.set_strv('folder-children', folders);
         } else {
+            // If this is a categories-based folder, also add it to
+            // the list of excluded apps
+            const categories = this._folder.get_strv('categories');
+            if (categories.length > 0) {
+                const excludedApps = this._folder.get_strv('excluded-apps');
+                excludedApps.push(app.id);
+                this._folder.set_strv('excluded-apps', excludedApps);
+            }
+
             this._folder.set_strv('apps', folderApps);
         }
     }